package com.buka.communicate.adapter;

import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.buka.communicate.R;
import com.buka.communicate.entity.User;

import net.neiquan.applibrary.base.MyBaseAdapter;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * 作者 ： dyj
 * 时间 ： 2016/12/29.
 */

public class WalletAdapter extends MyBaseAdapter<User, WalletAdapter.ViewHolder> {


    public WalletAdapter(Activity context, List data) {
        super(context, data);
    }

    @Override
    public int getItemCount() {
        return 6;
    }

    @Override
    protected ViewHolder getViewHolder() {
        return new ViewHolder(mInflater.inflate(R.layout.item_wallet, null));
    }

    @Override
    protected void onBindViewHolder_(final ViewHolder holder, int position) {
        holder.walletLL.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                holder.walletLL.setBackground(context.getResources().getDrawable(R.drawable.shape_solid_app_corlor));
            }
        });
    }


    static class ViewHolder extends RecyclerView.ViewHolder {

        @InjectView(R.id.walletLL)
        LinearLayout walletLL;
        @InjectView(R.id.mCoinNum)
        TextView mCoinNum;
        @InjectView(R.id.mCoinPay)
        TextView mCoinPay;
        @InjectView(R.id.mCoinEffect)
        TextView mCoinEffect;
        ViewHolder(View view) {
            super(view);
            ButterKnife.inject(this, view);
        }
    }
}
